package com.yifan.spring;

import com.yifan.spring.service.OrderService;
import com.yifan.spring.service.UserService;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

/**
 * @Author YIFan
 * @Date 2021/4/23 11:20
 * @Version 1.0
 */
public class Test {
    public static void main(String[] args) {
        AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(AppConfig.class);

        UserService userService = context.getBean("userService", UserService.class);

        OrderService orderService = context.getBean("orderService", OrderService.class);
        OrderService orderService1 = context.getBean("orderService1", OrderService.class);
        OrderService orderService2 = context.getBean("orderService2", OrderService.class);

        System.out.println(orderService);
        System.out.println(orderService1);
        System.out.println(orderService2);
    }
}
